#include "Launch.h"
#include "IRlocate.h"
#define SLOW .3

Launch::Launch() 
{
	Requires (launcher);
	Requires (turret);
	Requires (irsensors);
}
void Launch::Initialize()
{
	firing=0;
}
void Launch::Execute()
{
	if(irsensors->firing)
		launcher->fire(bottomspeed, topspeed);
	if(irsensors->GetSensor(7))
		firing=1;
	if(firing && !irsensors->GetSensor(7))
	{
		launcher->fire(SLOW, SLOW);
		firing=0;
	}
		
	turret->set(desiredPosition);
}
bool Launch::IsFinished()
{
 return 0;
}
void Launch::End()
{
	
}
void Launch::Interrupted()
{
	
}
